1. Field of the Invention
The invention relates to a method for processing packet. Particularly, the invention relates to a method for processing a packet and a routing apparatus thereof capable of improving a network processing performance.
2. Description of Related Art
With booming development of network technology, modern people may not only obtain required information through the network at any time, but can also conduct leisure, social and business activities through the network. However, due to the convenience of the network, a lot of important data are spread in the network. To avoid the data being maliciously captured, many safety control mechanisms are accordingly developed.
Taking a network apparatus using a Linux operating system as a software structure as an example, data safety is maintained through rule comparison of an access control list (ACL) rule and a quality of services (QoS) rule at a forward hook. In detail, to achieve a firewall effect, each time when a packet enters the network apparatus, the forward hook compares the packet with each of the ACL rule and the QoS rule. Namely, the forward hook sequentially obtains the ACL rule and the QoS rule, and has to obtain a packet information each time for comparing each of the rules. In some cases, only after all of the rules are compared, the network apparatus can determine whether such packet matches the ACL rule and the QoS rule. Therefore, when a number of the ACL rules and the QoS rules required to be compared is increased, longer time is required for accomplishing the check, which may have a negative influence on network processing performance.